## Loading required package: assertthat
## Warning: package 'assertthat' was built under R version 4.0.3
## 
## Attaching package: 'assertthat'
## The following object is masked from 'package:tibble':
## 
##     has_name
## Loading required package: glue
## Warning: package 'glue' was built under R version 4.0.3
## 
## Attaching package: 'glue'
## The following object is masked from 'package:dplyr':
## 
##     collapse
## Loading required package: rlang
## Warning: package 'rlang' was built under R version 4.0.3
## 
## Attaching package: 'rlang'
## The following object is masked from 'package:assertthat':
## 
##     has_name
## The following objects are masked from 'package:purrr':
## 
##     %@%, as_function, flatten, flatten_chr, flatten_dbl, flatten_int,
##     flatten_lgl, flatten_raw, invoke, list_along, modify, prepend,
##     splice
## `summarise()` has grouped output by 'ifbl_4by4', 'Jaar', 'TaxonIDParent'. You can override using the `.groups` argument.
## 
## -- Column specification --------------------------------------------------------
## cols(
##   id = col_double(),
##   code = col_character(),
##   naam_nederlands = col_character(),
##   naam_wetenschappelijk = col_character(),
##   taxn_vrs_key = col_character(),
##   taxongroep = col_character(),
##   usageKey = col_double(),
##   scientificName = col_character(),
##   rank = col_character(),
##   order = col_character(),
##   matchType = col_character(),
##   phylum = col_character(),
##   kingdom = col_character(),
##   genus = col_character(),
##   class = col_character(),
##   confidence = col_double(),
##   synonym = col_logical(),
##   status = col_character(),
##   family = col_character()
## )
## i Using ',' as decimal and '.' as grouping mark. Use `read_delim()` for more control.
## 
## -- Column specification --------------------------------------------------------
## cols(
##   substraat = col_character(),
##   substrate = col_character()
## )

1 Exploratory data analysis

phylum n_obs n_soorten n_hokken
Anthocerotophyta 218 4 123
Bryophyta 95624 410 796
Marchantiophyta 17486 109 727

## `summarise()` has grouped output by 'phylum'. You can override using the `.groups` argument.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Joining, by = "substraat"
phylum substrate number of species
Bryophyta artificial stone 84
Bryophyta bryophyte 3
Bryophyta decaying vegetation 21
Bryophyta decorticated wood 48
Bryophyta epiphytic on living wood 73
Bryophyta floating on water 1
Bryophyta gravel or sand 108
Bryophyta mineral soil 211
Bryophyta peat 47
Bryophyta rock, hard 95
Bryophyta rock, soft 38
Bryophyta soil on rock 68
Marchantiophyta artificial stone 9
Marchantiophyta bryophyte 17
Marchantiophyta decaying vegetation 18
Marchantiophyta decorticated wood 16
Marchantiophyta epiphytic on living wood 15
Marchantiophyta floating on water 3
Marchantiophyta gravel or sand 34
Marchantiophyta mineral soil 67
Marchantiophyta peat 30
Marchantiophyta rock, hard 14
Marchantiophyta rock, soft 14
Marchantiophyta soil on rock 20
phylum ell_l number of species
Bryophyta 1 9
Bryophyta 2 19
Bryophyta 3 37
Bryophyta 4 86
Bryophyta 5 125
Bryophyta 6 188
Bryophyta 7 189
Bryophyta 8 129
Bryophyta 9 15
Marchantiophyta 1 1
Marchantiophyta 3 20
Marchantiophyta 4 51
Marchantiophyta 5 51
Marchantiophyta 6 60
Marchantiophyta 7 56
Marchantiophyta 8 18
phylum ell_r number of species
Bryophyta 1 10
Bryophyta 2 63
Bryophyta 3 88
Bryophyta 4 67
Bryophyta 5 95
Bryophyta 6 141
Bryophyta 7 215
Bryophyta 8 101
Bryophyta 9 17
Marchantiophyta 1 28
Marchantiophyta 2 60
Marchantiophyta 3 20
Marchantiophyta 4 52
Marchantiophyta 5 30
Marchantiophyta 6 38
Marchantiophyta 7 21
Marchantiophyta 8 6
Marchantiophyta 9 2
phylum ell_f number of species
Bryophyta 1 12
Bryophyta 2 12
Bryophyta 3 61
Bryophyta 4 152
Bryophyta 5 187
Bryophyta 6 176
Bryophyta 7 51
Bryophyta 8 69
Bryophyta 9 54
Bryophyta 10 14
Bryophyta 11 4
Bryophyta 12 5
Marchantiophyta 4 15
Marchantiophyta 5 51
Marchantiophyta 6 52
Marchantiophyta 7 50
Marchantiophyta 8 47
Marchantiophyta 9 32
Marchantiophyta 10 9
Marchantiophyta 11 1
phylum ell_n number of species
Bryophyta 1 32
Bryophyta 2 195
Bryophyta 3 139
Bryophyta 4 196
Bryophyta 5 137
Bryophyta 6 71
Bryophyta 7 27
Marchantiophyta 1 43
Marchantiophyta 2 97
Marchantiophyta 3 45
Marchantiophyta 4 36
Marchantiophyta 5 23
Marchantiophyta 6 8
Marchantiophyta 7 5
phylum ell_t number of species
Bryophyta 2 52
Bryophyta 3 269
Bryophyta 4 142
Bryophyta 5 155
Bryophyta 6 108
Bryophyta 7 58
Bryophyta 8 13
Marchantiophyta 2 27
Marchantiophyta 3 113
Marchantiophyta 4 51
Marchantiophyta 5 43
Marchantiophyta 6 13
Marchantiophyta 7 2
Marchantiophyta 8 8

Only remove substrate levels with less than 5 species (for Ellenberg variables this is not necessary because they are included as continuous covariate).

## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2

phylum substrate n
Bryophyta artificial stone 84
Bryophyta decaying vegetation 21
Bryophyta decorticated wood 48
Bryophyta epiphytic on living wood 73
Bryophyta gravel or sand 108
Bryophyta mineral soil 211
Bryophyta peat 47
Bryophyta rock, hard 95
Bryophyta rock, soft 38
Bryophyta soil on rock 68
Marchantiophyta artificial stone 9
Marchantiophyta bryophyte 17
Marchantiophyta decaying vegetation 18
Marchantiophyta decorticated wood 16
Marchantiophyta epiphytic on living wood 15
Marchantiophyta gravel or sand 34
Marchantiophyta mineral soil 67
Marchantiophyta peat 30
Marchantiophyta rock, hard 14
Marchantiophyta rock, soft 14
Marchantiophyta soil on rock 20
## Warning: Ignoring unknown aesthetics: text
## `geom_smooth()` using formula 'y ~ x'
## Warning: Ignoring unknown aesthetics: text
## Warning in qlogis(prop_2000_2019): NaNs produced

## Warning in qlogis(prop_2000_2019): NaNs produced

## Warning in qlogis(prop_2000_2019): NaNs produced
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 7 rows containing non-finite values (stat_smooth).
## # A tibble: 126 x 2
##    n_hok_1980_1999     n
##              <int> <int>
##  1               0   245
##  2               5    34
##  3               6    18
##  4               7    18
##  5               8    12
##  6               9    22
##  7              10    12
##  8              11    14
##  9              12    11
## 10              13     8
## # ... with 116 more rows
## # A tibble: 142 x 2
##    n_hok_2000_2019     n
##              <int> <int>
##  1               0    18
##  2               1    87
##  3               2    60
##  4               3    35
##  5               4    32
##  6               5    26
##  7               6    27
##  8               7    12
##  9               8    17
## 10               9    25
## # ... with 132 more rows

2 Methods

3 Results

## Warning in checkMatrixPackageVersion(): Package version inconsistency detected.
## TMB was built with Matrix version 1.3.2
## Current Matrix version is 1.2.18
## Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
## Registered S3 method overwritten by 'broom.mixed':
##   method      from 
##   tidy.gamlss broom
## Warning in tidy.brmsfit(alt_telfer_3): some parameter names contain underscores:
## term naming may be unreliable!
effect component group term estimate std.error conf.low conf.high
fixed cond NA (Intercept) 0.4904610 0.1315195 0.2316668 0.7477269
fixed cond NA qlogisn_hok_1980_1999Dn_hok_tot_1980_1999 0.8964563 0.0173138 0.8631410 0.9301981
fixed cond NA phylumMarchantiophyta -0.7365657 0.1734234 -1.0744809 -0.3895969
fixed cond NA ell_f -0.0594441 0.0141049 -0.0868474 -0.0316259
fixed cond NA ell_t 0.0265169 0.0186195 -0.0099043 0.0630969
fixed cond NA qlogisn_hok_1980_1999Dn_hok_tot_1980_1999:phylumMarchantiophyta 0.0336040 0.0396186 -0.0438984 0.1119242
fixed cond NA phylumMarchantiophyta:ell_t 0.0925428 0.0381588 0.0181477 0.1674919
ran_pars cond substrate sd__(Intercept) 0.1613464 0.0518312 0.0851389 0.2810960
ran_pars cond substrate sd__phylumMarchantiophyta 0.1092055 0.0826154 0.0042748 0.3041457

## Adding missing grouping variables: `phylum`
## Note: Using an external vector in selections is ambiguous.
## i Use `all_of(ellenberg)` instead of `ellenberg` to silence this message.
## i See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This message is displayed once per session.
## Adding missing grouping variables: `phylum`
## Adding missing grouping variables: `phylum`
## Adding missing grouping variables: `phylum`

References

Bürkner, Paul-Christian. 2017. “Brms : An R Package for Bayesian Multilevel Models Using Stan.” Journal of Statistical Software 80 (1): 1–28. https://doi.org/10.18637/jss.v080.i01.

Gelman, Andrew, Jennifer Hill, and Masanao Yajima. 2012. “Why We (Usually) Don’t Have to Worry About Multiple Comparisons.” Journal of Research on Educational Effectiveness 5 (2): 189–211. https://doi.org/10.1080/19345747.2011.618213.

R Core Team. 2020. R: A Language and Environment for Statistical Computing. Manual. Vienna, Austria: R Foundation for Statistical Computing.

Telfer, Mark G, C. D. Preston, and Peter Rothery. 2002. “A General Method for Measuring Relative Change in Range Size from Biological Atlas Data.” Biological Conservation 107 (1): 99–109. https://doi.org/10.1016/S0006-3207(02)00050-2.

Vehtari, Aki, Andrew Gelman, and Jonah Gabry. 2017. “Practical Bayesian Model Evaluation Using Leave-One-Out Cross-Validation and WAIC.” Statistics and Computing 27 (5): 1413–32. https://doi.org/10.1007/s11222-016-9696-4.